package com.zhuss.controller.core;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zhuss.bean.bo.core.book.CreateBookBo;
import com.zhuss.bean.bo.core.book.DeleteBookBo;
import com.zhuss.bean.bo.core.book.StartBookBo;
import com.zhuss.bean.bo.core.book.StopBookBo;
import com.zhuss.bean.bo.core.book.UpdateBookBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.OperateService;
import com.zhuss.core.processor.BookRead;
import com.zhuss.exception.AabException;


/**
 * Book操作 controller
 * @Author zhushanshuo
   @Date 2019-11-27 19:58
 *
 */
  
 
@RestController
@RequestMapping("/book")
public class BookOperateController extends BaseController {
	
	@Autowired
	@Qualifier("bookOperateService")
	private OperateService<Void, Object> bookOperateService;
	
	@Autowired
	private BookRead bookRead;
	
	/**
	 * 创建
	 * @param bo
	 * @throws AabException
	 */
	@ResponseBody
    @PostMapping("/create")
    public void create(@RequestBody CreateBookBo bo) throws AabException {
		
		
		bookOperateService.create(bo);
    }
	
	/**
	 * 修改
	 * @param bo
	 * @throws AabException
	 */
	@ResponseBody
    @PostMapping("/update")
    public void update(@RequestBody UpdateBookBo bo) throws AabException {
		
		bookOperateService.update(bo);
    }
	
	/**
	 * 删除
	 * @param bo
	 * @throws AabException
	 */
	@ResponseBody
    @PostMapping("/delete")
    public void delete(@RequestBody DeleteBookBo bo) throws AabException {
		
		bookOperateService.delete(bo);
    }
	
	/**
	 * 启用
	 * @param bo
	 * @throws AabException
	 */
	@ResponseBody
    @PostMapping("/start")
    public void start(@RequestBody StartBookBo bo) throws AabException {
		
    }
	
	
	/**
	 * 停用
	 * @param bo
	 * @throws AabException
	 */
	@ResponseBody
    @PostMapping("/stop")
    public void stop(@RequestBody StopBookBo bo) throws AabException {
		
    }

	
}
